home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_13_11 / phillip2 / gpcips.c < prev    next >
C/C++ Source or Header  |  1993-06-04  |  3KB  |  108 lines

  1.  
  2.  
  3.     /******************************************************
  4.     *
  5.     *  file d:\cips\gpcips.c
  6.     *
  7.     *  Functions: This file contains
  8.     *      get_parameters
  9.     *      show_parameters
  10.     *      my_clear_text_screen
  11.     *
  12.     *  Purpose - These functions get image parameters.
  13.     *
  14.     *  External Calls:
  15.     *      intcvrt.c - get_integer
  16.     *
  17.     *  Modifications:
  18.     *      19 February 1987 - These functions were 
  19.     *           taken out of the file ip.c.
  20.     *      28 June 1990 - changed to gpcips and the
  21.     *           channel parameter was removed.
  22.     *      14 June 1993 - added the function
  23.     *           my_clear_text_screen
  24.     *
  25.     ******************************************************/
  26.  
  27.  
  28. #include "cips.h"
  29.  
  30.  
  31.  
  32.  
  33. get_parameters(il, ie, ll, le)
  34.         int *il, *ie, *le, *ll;
  35. {
  36.         int choice, not_finished;
  37.  
  38.         not_finished = 1;
  39.         while(not_finished){
  40.            show_parameters(il, ie, ll, le);
  41.            printf("\n\nEnter choice to change (enter 0 for no changes) __\b\b");
  42.            get_integer(&choice);
  43.  
  44.            switch (choice){
  45.               case 0:
  46.                  not_finished = 0;
  47.                  break;
  48.  
  49.               case 1:
  50.                  break;
  51.  
  52.               case 2:
  53.                  printf("\nEnter initial line\n___\b\b\b");
  54.                  get_integer(il);
  55.                  break;
  56.  
  57.               case 3:
  58.                  printf("\nEnter initial element\n___\b\b\b");
  59.                  get_integer(ie);
  60.                  break;
  61.  
  62.               case 4:
  63.                  printf("\nEnter last line\n___\b\b\b");
  64.                  get_integer(ll);
  65.                  break;
  66.  
  67.               case 5:
  68.                  printf("\nEnter last element\n___\b\b\b");
  69.                  get_integer(le);
  70.                  break;
  71.  
  72.            }  /* ends switch choice       */
  73.         }     /* ends while not_finished  */
  74. }             /* ends get_parameters      */
  75.  
  76.  
  77. show_parameters(il, ie, ll, le)
  78.         int *il, *ie, *le, *ll;
  79. {
  80.    printf("\n\nThe image parameters are:");
  81.    printf("\n\t2.      il = %4d", *il);
  82.    printf("\n\t3.      ie = %4d", *ie);
  83.    printf("\n\t4.      ll = %4d", *ll);
  84.    printf("\n\t5.      le = %4d", *le);
  85. }  /* ends show_parameters  */
  86.  
  87.  
  88.  
  89.  
  90.  
  91.    /*************************************************
  92.    *
  93.    *   my_clear_text_screen()
  94.    *
  95.    *   This calls Microsoft C functions to clear
  96.    *   the text screen and set a blue background
  97.    *   with gray text.
  98.    *
  99.    **************************************************/
  100.  
  101. my_clear_text_screen()
  102. {
  103.    my_setvideomode(TEXTC80);/* MSC 6.0 statements */
  104.    my_setbkcolor(1);
  105.    my_settextcolor(7);
  106.    my_clearscreen(GCLEARSCREEN);
  107. }  /* ends clear_text_screen */
  108.